﻿using PerformanceExamine.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PerformanceExamine
{
    public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
        }

        private void FormMain_Load(object sender, EventArgs e)
        {
            //Form form = FormFactory.CreateForm(0);
            Form form = FormFactory.CreateForm("FormUserManager");
            form.MdiParent = this;
            form.Parent = splitContainer1.Panel2;
            form.Show();
        }

        private void trvMenu_AfterSelect(object sender, TreeViewEventArgs e)
        {
            foreach (TreeNode tn in trvMenu.Nodes)
            {
                tn.BackColor = Color.White;
                tn.ForeColor = Color.Black;
            }
            e.Node.BackColor = SystemColors.Highlight; 
            e.Node.ForeColor = Color.White;

            Form form = FormFactory.CreateForm(e.Node.Tag.ToString());
            form.MdiParent=this;
            form.Parent=splitContainer1.Panel2;
            form.Show();
        }
    }
}
